home *** CD-ROM | disk | FTP | other *** search
- .include 'tao'
-
- ; Include the TinyGL asm stuff
- .include 'ad709/tinygl/glut'
-
-
- tool 'ami/content/ad709/tinygl/examples/asm/basicframework', VP, F_MAIN, 8192, 0
- ent (- : -)
- regdef pointer glutFuncs
- regdef pointer gluFuncs
- regdef pointer glutLib
- regdef pointer glFuncs
- regdef pointer glLib
- regdef pointer gluLib
- regdef pointer argv
- regdef int argc
- regdef int glutWindow
- regdef pointer vendor
-
- qcall lib/argcargv, (- : argv, argc)
-
- ; Get the pointers to the GL function table and GL lib handle
- qcall ami/lib/ad709/tinygl/init, (GL_LIB : glFuncs, glLib)
-
- ; Get the pointers to the GL function table and GL lib handle
- qcall ami/lib/ad709/tinygl/init, (GLUT_LIB : glutFuncs, glutLib)
-
- qcall ami/lib/ad709/tinygl/init, (GLU_LIB : gluFuncs, gluLib)
-
- ; Copy the pointers obtained above into a global area using GL and GLUT macros
- cpy.p glFuncs, GL
- cpy.p glutFuncs, GLUT
- cpy.p gluFuncs, GLU
-
- ; Call GLUT and GL functions using the glXXXXX macros to get the sub-routine pointer
- gos glutInit(GLUT), (argc, argv : -)
- gos glutInitWindowSize(GLUT), (320, 240 : -)
- gos glutInitWindowPosition(GLUT), (0, 0 : -)
- __string 'Basic OpenGL app'
- gos glutCreateWindow(GLUT), (__string_param.p : glutWindow)
-
- ; For demonstration purposes, the init procedure is defined in a seperate tool.
- ; The GL macro ensures the seperate tool can still find the functions table
- qcall ami/content/ad709/tinygl/examples/asm/basicframework_init, (- : -)
- gos glutDisplayFunc(GLUT), (display.p : -)
- gos glutIdleFunc(GLUT), (idle.p : -)
- gos gluLookAt(GLU), (0, 0, 0, 0, 0, 0, 0, 1, 0 : -)
- gos glutMainLoop(GLUT), (- : -)
-
- qcall ami/lib/ad709/tinygl/deinit, (glFuncs, glLib : -)
- qcall ami/lib/ad709/tinygl/deinit, (glutFuncs, glutLib : -)
- qcall ami/lib/ad709/tinygl/deinit, (gluFuncs, gluLib : -)
-
- ret ()
- entend
-
-
- display:
- ent (- : -)
- gos glClear(GL), (GL_COLOR_BUFFER_BIT : -)
- ret ()
- entend
-
-
- idle:
- ent (- : -)
- gos glutPostRedisplay(GLUT), (- : -)
- ret ()
- entend
-
- toolend
-
-
- tool 'ami/content/ad709/tinygl/examples/asm/basicframework_init', VP
- ent (- : -)
- gos glClearColor(GL), (0, 0, 0, 0 : -)
- gos glClear(GL), (GL_COLOR_BUFFER_BIT : -)
- ret ()
- entend
-
- toolend
-